<template>
    <div class="box" v-if="user">
        <div>
            <el-button style = "width: 100px;margin-left: 10px"  @click="updateGood(1)">上架装备</el-button>
            <el-button style = "width: 100px"  @click="updateGood(2)">上架其他</el-button>
        </div>

        <up-t-ct v-model="$store.state.dialogVisible1"></up-t-ct>
        <up-t-c v-model="$store.state.dialogVisible2">
        </up-t-c>
    </div>
    <div v-else>
        <span>还没登录呢.</span>
        <button @click="this.$router.push('/login')">点击登录</button>
        <span style="color: orange">登录后刷新，才能加载上架页面</span>
    </div>

</template>

<script>
    import UpTC from "./UpTC";
    import UpTCt from "./UpTCt";
    export default {
        name: "Add",
        components: {UpTCt, UpTC},
        data(){
          return{
              user: JSON.parse(sessionStorage.getItem("user"))
          }
        },
        created() {
        },
        methods:{
            updateGood(TC){
                if(TC == 1){
                    this.$store.state.dialogVisible1 = true
                }else {
                    this.$store.state.dialogVisible2 = true
                }
            },
        },
    }
</script>

<style scoped>
    .box{
        height: 100vh;
        background: url("../../assets/img/806.jpg");
        display: flex;
        align-items: center;
        justify-content: space-around;
    }
    .price{
        display: flex;
        align-items: center;
        justify-content: space-around;
    }
</style>
<style>
    .el-cascader-panel {
        max-width:300px;
    }
    .el-cascader-menu__list{
        width: 100px;
    }
    .el-cascader-menu{
        min-width: 100px
    }
</style>